import myAxios from "@/request";

interface userInfoRequest {
  phone?: string;
  username?: string;
  birth_day?: string;
  sex?: string;
  signature?: string;
}

export const userInfo = async (params: userInfoRequest) => {
  return await myAxios.request({
    url: "/user/setting/info",
    method: "put",
    data: params,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

export const userAvatar = async (params: FormData) => {
  return await myAxios.request({
    url: "/user/setting/avatar",
    method: "put",
    data: params,
  });
};

export const userPassword = async (params: {
  oldPassword: string;
  newPassword: string;
}) => {
  return await myAxios.request({
    url: "/user/setting/password",
    method: "put",
    data: params,
  });
};
